from fractions import gcd

def GetAns(n):
	if n<=1:
		return 1
	elif n==2:
		return 2
	else:
		ans = n * (n-1)
		t = 0
		for i in xrange(n-2, 0, -1):
			gc = i/gcd(ans,i)
			if gc>t:
				t = gc
		ans *= t
		return ans


n = input()
	
print max(GetAns(n), GetAns(n-1))
